﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using B2B.Business;
using WeiDuan.Model;

namespace B2B.Service
{
    public interface IOrderService
    {
        /// <summary>
        /// 浏览采购目录
        /// </summary>
        /// <param name="req"></param>
        /// <param name="user"></param>
        /// <returns></returns>
        List<ProductPackSKUInfo> QueryProductPrice(string ClassID, UserInfo user);

        /// <summary>
        /// 保存草稿
        /// </summary>
        /// <param name="req"></param>
        /// <param name="user"></param>
        /// <returns></returns>
        string Add(OrderAddRequest req, UserInfo user);

        /// <summary>
        /// 修改订单
        /// </summary>
        /// <param name="req"></param>
        /// <param name="user"></param>
        void Update(OrderUpdateRequest req, UserInfo user);

        /// <summary>
        /// 提交订单
        /// </summary>
        /// <param name="req"></param>
        /// <param name="user"></param>
        void Submit(string OrderID, UserInfo user);

        /// <summary>
        /// 作废一笔订单
        /// </summary>
        /// <param name="id"></param>
        /// <param name="user"></param>
        void Delete(string id, UserInfo user);

        /// <summary>
        /// 删除订单中的一笔商品
        /// </summary>
        /// <param name="itemId"></param>
        /// <param name="user"></param>
        void DeleteItem(string itemId, UserInfo user);

        /// <summary>
        /// 销售方确认订单
        /// </summary>
        /// <param name="id"></param>
        /// <param name="user"></param>
        void Audit(string id, UserInfo user);

        /// <summary>
        /// 供应商确认
        /// </summary>
        /// <param name="id"></param>
        /// <param name="user"></param>
        void ProviderConfirm(string id, UserInfo user);

        /// <summary>
        /// 供应商退回
        /// </summary>
        /// <param name="id"></param>
        /// <param name="user"></param>
        void ProviderCancel(string id, UserInfo user);

        /// <summary>
        /// 销售方发货
        /// 在记录发货信息的同时，记录买卖双方及平台的账务信息（待收，待付）
        /// </summary>
        /// <param name="req"></param>
        /// <param name="user"></param>
        void SendExpress(SendExpressRequest req, UserInfo user);

        /// <summary>
        /// 购买方确认收货（单笔物流）
        /// </summary>
        /// <param name="ExpressID">针对发货单号</param>
        /// <param name="user"></param>
        void AcceptExpress(string ExpressID, UserInfo user);

        /// <summary>
        /// 查询订单
        /// </summary>
        /// <param name="req"></param>
        /// <param name="user"></param>
        /// <returns></returns>
        OrderQueryResponse QueryPage(PageQueryRequest<OrderQueryRequest> req, UserInfo user);

        /// <summary>
        /// 根据订单状态查询订单清单(买方）
        /// </summary>
        /// <param name="status">草稿/正在执行/已完成</param>
        /// <param name="user"></param>
        /// <returns>返回Order列表</returns>
        List<OrderInfo> Query(OrderQueryRequest req, UserInfo user);

        /// <summary>
        /// 根据订单状态查询订单清单（平台方）
        /// </summary>
        /// <param name="status">草稿/正在执行/已完成</param>
        /// <param name="user"></param>
        /// <returns>返回Order列表</returns>
        List<OrderInfo> QueryBySaler(OrderQueryRequest req, UserInfo user);

        /// <summary>
        /// 根据订单状态查询订单清单（供应商）
        /// </summary>
        /// <param name="status">草稿/正在执行/已完成</param>
        /// <param name="user"></param>
        /// <returns>返回Order列表</returns>
        List<OrderInfo> QueryByProvider(OrderQueryRequest req, UserInfo user);

        OrderQueryResponse QueryByProviderPage(PageQueryRequest<OrderQueryRequest> req, UserInfo user);

        /// <summary>
        /// 查询单笔订单信息
        /// </summary>
        /// <param name="id"></param>
        /// <param name="user"></param>
        /// <returns></returns>
        OrderInfo QueryDetail(string id, UserInfo user);

        /// <summary>
        /// 获取订单状态
        /// </summary>
        /// <param name="user"></param>
        /// <returns></returns>
        EnumValue[] GetOrderStatus(UserInfo user);

    }
}
